package com.ylfstu.Homework.homework13;

public class Student extends Person {
    private String id;

    @Override
    public void printMessage() {
        System.out.println("----------------");
        System.out.println("学生的信息:");
        super.printMessage();
        System.out.println("学号:" + getId());
        study();
        System.out.println(play());
    }

    @Override
    public String play() {
        return super.play() + "足球";
    }

    public void study() {
        System.out.println("我承诺，我会好好学习。");
    }

    public Student(String name, char gender, int age, String id) {
        super(name, gender, age);
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
}
